package wechatsmart

import "encoding/xml"

type ErrorRes struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

type SmartBody struct {
	Encrypt string `json:"encrypt"`
}

type RobotRelease struct {
	XMLName   xml.Name `xml:"xml"`
	ManagerId CDATA    `xml:"managerid"`
}

type ImportSkillReq struct {
	Skill []BatchImportSkillReq `json:"skill"`
}

type BatchImportSkillReq struct {
	SkillName string   `json:"skillname" `
	Title     string   `json:"title"`
	Question  []string `json:"question"`
	Answer    []string `json:"answer"`
}

type BatchImportSkillRes struct {
	XMLName   xml.Name `xml:"xml"`
	ManagerId CDATA    `xml:"managerid"`
	Skill     []Skill  `xml:"skill"`
}

type Skill struct {
	SkillName CDATA   `xml:"skillname"`
	Title     CDATA   `xml:"title"`
	Question  []CDATA `xml:"question"`
	Answer    []CDATA `xml:"answer"`
}

type GetSignatureReq struct {
	UserName string `json:"username"`
	Avatar   string `json:"avatar"`
	UserId   string `json:"userid"`
}

type SmartDialogueReq struct {
	Signature            string   `json:"signature"`
	Query                string   `json:"query"`
	Env                  string   `json:"env"`
	FirstPrioritySkills  []string `json:"first_priority_skills"`
	SecondPrioritySkills []string `json:"second_priority_skills"`
}

type SetAutoReplyReq struct {
	ManagerId string   `json:"managerId"`
	SkillName string   `json:"skillName"`
	Title     string   `json:"title"`
	Content   string   `json:"content"`
	List      []string `json:"list"`
}

type Question struct {
	Question []CDATA `xml:"question"`
}

type SetAutoReplyRes struct {
	XMLName   xml.Name `xml:"xml"`
	ManagerId CDATA    `xml:"managerid"`
	SkillName CDATA    `xml:"skillname"`
	Title     CDATA    `xml:"title"`
	Content   CDATA    `xml:"content"`
	List      Question `xml:"list"`
}

type SetLabelBatchReq struct {
	AppId    string   `json:"appId"`
	Category string   `json:"category"`
	Label    string   `json:"label"`
	Desc     string   `json:"desc"`
	List     []string `json:"list"`
}

type SetLabelBatchRes struct {
	AppId    string   `xml:"appid"`
	Category string   `xml:"category"`
	Label    string   `xml:"label"`
	Desc     string   `xml:"desc"`
	List     []string `xml:"list"`
}

type HotQueryListReq struct {
	PageNo     int    `json:"pageNo"`
	PageSize   int    `json:"pageSize"`
	MatchType  int    `json:"matchType"`
	CluesType  int    `json:"cluesType"`
	ReportType int    `json:"reportType"`
	Date       string `json:"date"`
	Openid     string `json:"openid"`
}

type HotQueryListRes struct {
	PageNo     int    `xml:"pageNo"`
	PageSize   int    `xml:"pageSize"`
	MatchType  int    `xml:"matchType"`
	CluesType  int    `xml:"cluesType"`
	ReportType int    `xml:"reportType"`
	Date       string `xml:"date"`
	Openid     string `xml:"openid"`
}

type ResponseEncryptedXMLMsg struct {
	XMLName      struct{} `xml:"xml" json:"-"`
	EncryptedMsg string   `xml:"Encrypt"      json:"Encrypt"`
	MsgSignature string   `xml:"MsgSignature" json:"MsgSignature"`
	Timestamp    int64    `xml:"TimeStamp"    json:"TimeStamp"`
	Nonce        string   `xml:"Nonce"        json:"Nonce"`
}

type SendCustomerServiceMsg struct {
	AppId      string `json:"appid" xml:"appid"`           //公众号或小程序的appid
	Openid     string `json:"openid" xml:"openid"`         //用户的微信openid
	Msg        string `json:"msg" xml:"msg"`               //消息内容
	Channel    int    `json:"channel" xml:"channel"`       //渠道ID，详见渠道对映表
	KeFuName   string `json:"kefuname" xml:"kefuname"`     //客服人员的昵称
	KeFuAvatar string `json:"kefuavatar" xml:"kefuavatar"` //客服人员的头像
}

type EncryptData struct {
	EncryptedMsg string `xml:"Encrypt"      json:"Encrypt"`
	MsgSignature string `xml:"MsgSignature" json:"MsgSignature"`
	Timestamp    string `xml:"TimeStamp"    json:"TimeStamp"`
	Nonce        string `xml:"Nonce"        json:"Nonce"`
}
